<?php

/**
 * Interface declaration for postal mailing addresses
 *
 * PHP version 5
 *
 * LICENSE:
 *
 * Copyright (c) 2007-2009, Philippe Jausions / 11abacus
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *   - Neither the name of 11abacus nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @category  Structures
 * @package   Structures_Location
 * @author    Philippe Jausions <Philippe.Jausions@11abacus.com>
 * @copyright 2007-2009 by Philippe Jausions / 11abacus
 * @license   http://www.opensource.net/licenses/bsd-license.php New BSD
 */

/**
 * Load location interface declaration
 */
require_once 'Structures/LocationInterface.php';

/**
 * Interface declaration for postal mailing address type of objects
 *
 * @category Structures
 * @package  Structures_Location
 * @author   Philippe Jausions <Philippe.Jausions@11abacus.com>
 */
interface Structures_Location_PostalAddressInterface 
extends Structures_LocationInterface 
{
    /**
     * Returns the postal code 
     * 
     * @return string|NULL Postal code or NULL if not-applicable or none is set
     */
    public function getPostalCode();

    /**
     * Returns postal office
     * 
     * This is often useful for rural locations where mail is delivered to the
     * closest town. Postal office and locality are often used interchangeably.
     * 
     * Implementation of this interface should provide whichever is more 
     * appropriate and should also return something if either one is available. 
     * 
     * @return string|NULL Postal office or NULL if none is set
     */
    public function getPostalOffice();

    /**
     * Returns the postal region code
     * 
     * Postal region can be state/province/county/emirate/etc...
     * 
     * @return string|NULL Postal region code or NULL if none is set
     */
    public function getPostalRegionCode();

    /**
     * Returns the postal sub region information 
     * 
     * Sub-region can be county/etc... This is of course locale-dependent
     * 
     * @return string|NULL Sub-region information or NULL if not-applicable 
     *                     or none is set
     */
    public function getPostalSubRegion();
    
    /**
     * Returns post-office box number
     * 
     * @return string|NULL PO Box number or NULL if none is set
     */
    public function getPostOfficeBox();

    /**
     * Determines if the mailing address is "poste restante" (aka "General Delivery")
     * 
     * Poste Restante mail is to be picked up at the post office, and is 
     * different from post office boxes.
     *
     * @return boolean TRUE if poste restante, FALSE otherwise or unknown
     */
    public function isPosteRestante();

    /**
     * Determines if the mailing address is for a post office box (PO Box)
     * 
     * @return boolean|NULL TRUE if PO Box, FALSE otherwise or NULL if unknown
     */
    public function isPostOfficeBox();
    
    /**
     * Sets if the mailing address is "poste restante" 
     * (aka "General Delivery")
     * 
     * Poste Restante mail is to be picked up at the post office, and is 
     * different from post office boxes.
     *
     * @param boolean $status Whether or not the address is to be considered
     *                        "Poste Restante". Pass NULL to reset to "unknown"
     * @return void
     */
    public function setPosteRestante($status);

    /**
     * Sets the postal code 
     * 
     * @param string $code Postal code
     * 
     * @return void
     */
    public function setPostalCode($code);

    /**
     * Sets postal office
     * 
     * This is often useful for rural locations where mail is delivered to the
     * closest town. Postal office and locality are often used interchangeably.
     * 
     * @param string $name Postal office
     * 
     * @return void
     */
    public function setPostalOffice($name);

    /**
     * Sets the postal region code
     * 
     * Depending on the country, region can be state/province/emirate/etc...
     * 
     * @param string $code Postal region code
     * 
     * @return void
     */
    public function setPostalRegionCode($code);

    /**
     * Sets the postal sub region information 
     * 
     * Sub-region can be county/etc... This is of course locale-dependent
     * 
     * @param string $name Postal sub-region information
     * 
     * @return void
     */
    public function setPostalSubRegion($name);
    
    /**
     * Sets post-office box number
     * 
     * @param integer|string $number PO Box number
     * 
     * @return void
     */
    public function setPostOfficeBox($number);
}

?>